# -*- config:utf-8 -*-

import logging
import os
from datetime import timedelta

project_name = "entrenate"

    
#defino el basedir 
basedir = os.path.abspath(os.path.dirname(__file__))

class Config(object):
    # use DEBUG mode?
    DEBUG = False


    # use TESTING mode?
    TESTING = False

    # use server x-sendfile?
    USE_X_SENDFILE = False

    # DATABASE CONFIGURATION
    
    DB_IP= "127.0.0.1"
    SQLALCHEMY_DATABASE_URI = "mysql://root:31824169@127.0.0.1/entrenate"
    SQLALCHEMY_ECHO = False

    CSRF_ENABLED = True
    # LOGGING
    LOGGER_NAME = "%s_log" % project_name
    LOG_FILENAME = "%s.log" % project_name
    LOG_LEVEL = logging.INFO
    LOG_FORMAT = "%(asctime)s %(levelname)s\t: %(message)s" # used by logging.Formatter

    PERMANENT_SESSION_LIFETIME = timedelta(days=1)

    # EMAIL CONFIGURATION
    MAIL_SERVER = "localhost"
    MAIL_PORT = 25
    MAIL_USE_TLS = False
    MAIL_USE_SSL = False
    MAIL_DEBUG = False
    MAIL_USERNAME = None
    MAIL_PASSWORD = None
    DEFAULT_MAIL_SENDER = "example@%s.com" % project_name

    # see example/ for reference
    # ex: BLUEPRINTS = ['blog.app']  # where app is a Blueprint instance
    # ex: BLUEPRINTS = [('blog.app', {'url_prefix': '/myblog'})]  # where app is a Blueprint instance
    BLUEPRINTS = [
    ]  # each as (blueprint_instance, url_preffix)

    CSRF_ENABLED = True
    SECRET_KEY = 'a-q-no-me-hackeas-ni-en-dope'
    
    OPENID_PROVIDERS = [
        { 'name': 'Google', 'url': 'https://www.google.com/accounts/o8/id' },
        { 'name': 'Yahoo', 'url': 'https://me.yahoo.com' },
        { 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' },
        { 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },
        { 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]
    
    LOGIN_DISABLED = False
    
    UPLOADED_PHOTOS_DEST = '/tmp'
    ALLOWED_EXTENSIONS = set(['pdf', 'png', 'jpg', 'jpeg', 'gif'])
    
    SOLR_URL = 'http://localhost:8983/solr/entrenate/'

class Dev(Config):
    DEBUG = True
    MAIL_DEBUG = True
    SQLALCHEMY_ECHO = True
    host = '127.0.0.1'
    database = 'entrenate'
    user = 'root'
    password = '123456'

class Testing(Config):
    TESTING = True
    CSRF_ENABLED = False
    SQLALCHEMY_ECHO = False
